package com.lianzhihui.romeex.mvp.presenter;

import android.content.Context;

import com.lianzhihui.romeex.bean.EcologicalBean;
import com.lianzhihui.romeex.mvp.model.EcologicalModelImp;
import com.lianzhihui.romeex.mvp.model.EcologicalModelInterface;
import com.lianzhihui.romeex.mvp.view.EcologicalView;

//逻辑实现
public class EcologicalPresnterImp implements EcologicalModelInterface {

    private final EcologicalView viewLayer;
    private final EcologicalModelImp modelImp;

    public EcologicalPresnterImp(Context context, EcologicalView viewLayer) {
        this.viewLayer = viewLayer;
        modelImp = new EcologicalModelImp(context, this);
    }


    public void requestMinnerMyBalance() {
        modelImp.requestMinnerMyBalance();
    }

    public void requestMinnerTransfer(String targetAddress, String amount) {
        modelImp.requestMinnerTransfer(targetAddress, amount);
    }

    @Override
    public void onFailure() {
        viewLayer.setFailure();
    }


    @Override
    public void responseMinnerMyBalanceSuccess(EcologicalBean b) {
        viewLayer.responseMinnerMyBalanceSuccess(b);
    }

    @Override
    public void responseMinnerTransferSuccess() {
        viewLayer.responseMinnerTransferSuccess();
    }


}
